<!DOCTYPE html>
<html>
<head>
    <title>Basic usage</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    
        <div id="example">

            <div class="box">
                <h4>Configuration</h4>
                <ul class="options">
                    <li><label for="cursorOffset"><input type="checkbox" id="cursorOffset"> Enable <code>cursorOffset</code></label></li>
                    <li><label for="axis">Axis: <select id="axis">
                                <option value="">(none)</option>
                                <option value="x">Horizontal (x)</option>
                                <option value="y">Vertical (y)</option>
                        </select></label></li>
                </ul>
            </div>

            <div class="demo-section">
                <div id="draggable"></div>
                <div id="droptarget" class="k-header">Start dragging.</div>
            </div>

            <script>
                function draggableOnDragStart(e) {
                    $("#draggable").addClass("hollow");

                    $("#droptarget").text("(Drop here)");
                }

                function droptargetOnDragEnter(e) {
                    $("#droptarget").text("Now drop...");
                }

                function droptargetOnDragLeave(e) {
                    $("#droptarget").text("(Drop here)");
                }

                function droptargetOnDrop(e) {
                    $("#droptarget").text("You did great!");
                    $("#draggable").removeClass("hollow");
                }

                function draggableOnDragEnd(e) {
                    var draggable = $("#draggable");

                    if (!draggable.data("kendoDraggable").dropped) {
                        // drag ended outside of any droptarget
                        $("#droptarget").text("Try again!");
                    }

                    draggable.removeClass("hollow");
                }

                $(document).ready(function() {
                    $("#draggable").kendoDraggable({
                        hint: function() {
                            return $("#draggable").clone();
                        },
                        dragstart: draggableOnDragStart,
                        dragend: draggableOnDragEnd
                    });

                    $("#droptarget").kendoDropTarget({
                        dragenter: droptargetOnDragEnter,
                        dragleave: droptargetOnDragLeave,
                        drop: droptargetOnDrop
                    });

                    var draggable = $("#draggable").data("kendoDraggable");

                    $("#cursorOffset").click(function(e) {
                        if (this.checked) {
                            draggable.options.cursorOffset = { top: 10, left: 10 };
                        } else {
                            draggable.options.cursorOffset = null;
                        }
                    });

                    $("#axis").change(function(e) {
                        draggable.options.axis = $(this).val();
                    });
                });
            </script>

            <style scoped>
                #droptarget
                {
                    height: 198px;
                    width: 300px;
                    font-size: 36px;
                    border-radius: 37px;
                    text-align: center;
                    line-height: 198px;
                    margin: 0 0 30px 220px;
                    cursor: default;
                }

                .demo-section
                {
                    width: 520px;
                    position: relative;
                    background: url(../content/web/dragdrop/drag-clue.png) no-repeat 155px 130px;
                }

                #exampleTitle
                {
                    color: #000;
                }
                
                #draggable 
                {
                    top: 110px;
                }
            </style>
        </div>


    
    
</body>
</html>
